<template>
    <div>
        <div>firstName:<input v-model="firstName"/></div>
        <div>middleName:<input v-model="middleName"/></div>
        <div>lastName:<input v-model="lastName"/></div>
        <div>fullName:<input v-model="fullName"/></div>
    </div>
</template>

<script>
export default {
  data(){
    return{
      firstName:'zhai',
      middleName:'ji',
      lastName:'zhe'
    }
  },
  computed:{
    fullName:{
      get(){
        return this.firstName+" "+this.middleName+" "+this.lastName
      },
      set(arg){
        let ary=arg.split(" ")
        this.firstName=ary[0]
        this.middleName=ary[1]
        this.lastName=ary[2]
      }
    }
  }
}
</script>

<style>

</style>